home *** CD-ROM | disk | FTP | other *** search
- In a message of 23 Jan 96 John Hendrikx wrote to All:
-
- JH> I don't think 'scanning' the database should become common among
- JH> applications, so a good solution should be offered. At the moment the
- JH> display database does not tell you whether a screen is Chunky or Planar,
- JH> or whether its layout is BGR or RGB and so on... we need more info from
- JH> the data-base and a better way to get that info.
-
- Yep. Basically there needs to be a standard way of specifying display
- properties.. There was an interesting post on comp.graphics,algorithms on this
- topic..
-
- *** Area: comp.graphics.algorithms Date: 24 Jan 96 21:19:28 ***
- From: Vinnie Falco (2:999/99.0)
-
- IMHO this group would greatly benefit from all answers concerning pixel images
- to be phrased in the form of C code, where images are represented with 8 bits
- per color component, 0=black, 255=white.
-
- RGB = 8 bits per Red, Green, and Blue component (total 24 bits) CMYK = 8 bits
- per Cyan, Magenta, Yellow, Black compoenents (total 32 bits) Lab = 8 bits per
- L, a, b, with L=255 meaning 100 in the usual sense,
- and with a and b being unsigned characters, 0..255 maps to the range
- -127..127 with 128 representing a or b of zero. Grayscale = 8 bits for Black
- (total 8 bits).
-
- Most images in memory can be laid out in any format (interleaved, planar,
- etc...)
- using the following variables :
-
- baseAddr = pointer to the first plane of the first row of the first column
- rowBytes = number of bytes per row of pixels colBytes = number of bytes per
- column of pixels planeBytes = number of bytes between one plane of color data
- and the next.
-
- For example, an RGB interleaved image can be represented like this : rowBytes =
- columns * 3
- colBytes = 3
- planeBytes = 1
-
- An RGB image stored planar (all the reds, then greens, then blues) can be
- represented like this :
- rowBytes = columns
- colBytes = 1
- planeBytes = rows * columns
-
- Even a Windows specific RGB bitmap (which is stored BGR) can be represented
- like
- this :
- baseAddr = <pointer to beginning of data> + 2 rowBytes = columns * 3
- colBytes = 3
- planeBytes = -1
-
- This in-memory format can represent the vast majority of image formats.
-
- Ben... :)
-
-